**************************************
****** Replication Main Article ******
************************************** 

clear all
set more off


*Packages needed
*Scheme:
net install scheme-modern, from("https://raw.githubusercontent.com/mdroste/stata-scheme-modern/master/")
* Addplot
ssc install addplot
* Coefplot
ssc install coefplot
* Firthlogit
ssc install firthlogit
* xlincom
ssc install xlincom

set scheme modern


cd ""

use reb_ideol_const_design_data, clear



*TABLE 1
tab result newcons2 if rev_reb==1, r
tab result amendment if rev_reb==1, r
tab result no_change if rev_reb==1,r

tab result newcons2 if rev_reb==0, r
tab result amendment if rev_reb==0, r
tab result no_change if rev_reb==0,r
*Results manually included in "Table1.tex"



*TABLE 2
ttest dif_total_pwa if socialist==1, by(result)
ttest dif_total_pwa if secess==1, by(result)
ttest dif_total_pwa if socialist!=1 & secess!=1, by(result)

ttest dif_identity_pwa if socialist==1, by(result)
ttest dif_identity_pwa if secess==1, by(result)
ttest dif_identity_pwa if socialist!=1 & secess!=1, by(result)
*Results manually included in "Table2.tex"




*FIGURE 1
firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc
firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec

firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc
firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec

firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc
firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec


coefplot newcsoc newcsec,  bylabel((a) New Constitution) subtitle(,size(*1.62))     || amendsoc amendsec, bylabel((b) Amendment) || no_changesoc no_changesec, bylabel((c) No change) ||, xline(0) byopts(xrescale rows(1) legend(off)) graphregion(color(white)) ysize(1) xsize(4)  xline(0, lpattern(dash) lcolor(cranberry) lwidth(1.05pt)) nolab drop(0.socialist 0.secess) coeflabel (1.socialist="RS  " 1.secess="Secessionist  ") aspectratio(0.7) msize(*3) ciopts(lwidth(*3)) 
addplot 1: ,  xlabel(-1(0.5)1) norescaling ylabel(, labsize(*1.9)) xlabel(, labsize(*1.9)) xscale(range(-1.2 1.2)) 
addplot 2: ,  xlabel(-1(0.5)1) norescaling ylabel(, labsize(*1.9)) xlabel(, labsize(*1.9)) xscale(range(-1.2 1.2))
addplot 3: ,  xlabel(-1(0.5)1) norescaling xscale(range(-1.2 1.2))

graph export "Figure1.eps", as(eps) name("Graph") preview(on) replace

 
 
 
*FIGURE 2

*Identity
reg dif_identity_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Midentitysoc

reg dif_identity_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec

*Total rights
reg dif_total_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Mtotalsoc

reg dif_total_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec


coefplot  Midentitysoc Midentitysec, bylabel((a) Symbolic Contents) subtitle(,size(*1.3))  ||  Mtotalsoc Mtotalsec,  bylabel((b) Number of Rights) subtitle(,size(*1.3))     ||, xline(0) byopts(xrescale rows(1) legend(off)) graphregion(color(white)) ysize(1.1) xsize(3.8) xline(0, lpattern(dash) lcolor(cranberry) lwidth(1.01pt)) nolab drop(0.socialist 0.secess) coeflabel (1.socialist="RS   " 1.secess="Secessionist   ") aspectratio(0.5) msize(*2.5) ciopts(lwidth(*2.5)) 
addplot 1: ,  xlabel(-5(2)5) norescaling ylabel(, labsize(*3)) xlabel(, labsize(*3)) xscale(range(-5.5 5.5)) 
addplot 2: ,   xlabel(-40(20)40) norescaling xscale(range(-45 45)) 

 graph export "Figure2.eps", as(eps) name("Graph") preview(on) replace


 sleep 5000
 
 
 
 
*FIGURE 3

*Identity
reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Midentitysoc

reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Midentitymao

reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec

*Total rights
reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mtotalsoc

reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mtotalmao

reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec


coefplot  Midentitysoc Midentitymao Midentitysec, bylabel((a) Symbolic Contents) subtitle(,size(*1.05)) ||  Mtotalsoc Mtotalmao Mtotalsec,  bylabel((b) Number of Rights) subtitle(,size(*1.1))    ||, xline(0) byopts(xrescale rows(1) legend(off)) graphregion(color(white)) ysize(3.2) xline(0, lpattern(dash) lcolor(cranberry)) nolab drop(0.non_maoist_rs 0.secess 0.maoist) coeflabel (1.non_maoist_rs="Non-Maoist RS  " 1.secess="Secessionist  " 1.maoist="Maoist  ") msize(*1.5) ciopts(lwidth(*1.5))
addplot 1: ,  xlabel(-6(2)6) norescaling ylabel(, labsize(*1.7)) xlabel(, labsize(*1.7)) xscale(range(-6.5 6.5)) 
addplot 2: ,   xlabel(-60(20)60) norescaling xscale(range(-65 65)) 

graph export "Figure3.eps", as(eps) name("Graph") preview(on) replace




*TABLE 3

program appendmodels, eclass
    // using first equation of model
    version 8
    syntax namelist
    tempname b V tmp
    foreach name of local namelist {
        qui est restore `name'
        mat `tmp' = e(b)
        local eq1: coleq `tmp'
        gettoken eq1 : eq1
        mat `tmp' = `tmp'[1,"`eq1':"]
        local cons = colnumb(`tmp',"_cons")
        if `cons'<. & `cons'>1 {
            mat `tmp' = `tmp'[1,1..`cons'-1]
        }
        mat `b' = nullmat(`b') , `tmp'
        mat `tmp' = e(V)
        mat `tmp' = `tmp'["`eq1':","`eq1':"]
        if `cons'<. & `cons'>1 {
            mat `tmp' = `tmp'[1..`cons'-1,1..`cons'-1]
        }
        capt confirm matrix `V'
        if _rc {
            mat `V' = `tmp'
        }
        else {
            mat `V' = ///
            ( `V' , J(rowsof(`V'),colsof(`tmp'),0) ) \ ///
            ( J(rowsof(`tmp'),colsof(`V'),0) , `tmp' )
        }
    }
    local names: colfullnames `b'
    mat coln `V' = `names'
    mat rown `V' = `names'
    eret post `b' `V'
    eret local cmd "whatever"
end

*Civil and Political
reg dif_civpol_pwa result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans 
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_civpol_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_civpol_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo civpolrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


*Social 
reg dif_social_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_social_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_social_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo socialrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec

 
*ECONOMIC RIGHTS
reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo econrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec

 
*legal procedural
reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo procrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec

 
*legal equality and minorities
 reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

 reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

 reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo equalrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


*Physical
 reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

 reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

 reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo physrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


 *UDHR
reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo udhrrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


*No UDHR
reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo noudhrrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


esttab civpolrights socialrights econrights procrights equalrights physrights udhrrights noudhrrights,  rename (lc_1 "Non-Maoist RS" lc_1 "Maoist RS" lc_1 "Secessionist" ) replace b(2) se(2)  se star(* 0.10 ** 0.05 *** 0.01 )  noomitted unstack  l nogaps nodep  mgroups("Civil and" "Social" "Economic" "Legal and" "Equality" "Physical" "UDHR" "NO", pattern(1 1 1 1 1 1 1 1) ) mtitles( "Political" " " " " "Procedural " " " "Integrity" " " "UDHR")  nonumbers  compress  title("Marginal effects by type of rights \label{merights}") eqlabels(none)

/*
esttab civpolrights socialrights econrights procrights equalrights physrights udhrrights noudhrrights using "Table3.tex",  rename (lc_1 "Non-Maoist RS" lc_1 "Maoist RS" lc_1 "Secessionist" ) replace b(2) se(2)  se star(* 0.10 ** 0.05 *** 0.01 )  noomitted unstack  l nogaps nodep  mgroups("Civil and" "Social" "Economic" "Legal and" "Equality" "Physical" "UDHR" "NO", pattern(1 1 1 1 1 1 1 1) ) mtitles( "Political" " " " " "Procedural " " " "Integrity" " " "UDHR")  nonumbers  compress  title("Marginal effects by type of rights \label{merights}") eqlabels(none)
*The number of observations is included manually in the tex using the regression outputs
*/





************************
****** APPENDIX ********
************************

clear all
set more off


*Packages needed
*Scheme:
net install scheme-modern, from("https://raw.githubusercontent.com/mdroste/stata-scheme-modern/master/")
* Addplot
ssc install addplot
* Coefplot
ssc install coefplot
* Firthlogit
ssc install firthlogit
* xlincom
ssc install xlincom


set scheme modern


cd ""

use reb_ideol_const_design_data, clear



*FIGURE A1
twoway (histogram aux_inc,   color(red%30) frequency xtitle("Years after the war in which a new constitution was enacted") xscale(range(0 10)) xlabel(0(1)10) discrete xline(5.5, lcolor(black) lwidth(0.5)) ) (histogram aux_notinc,   color(green%30) frequency xtitle("Years after a new constitution was enacted after the war") xscale(range(0 10)) xlabel(0(1)10) discrete xline(5.5, lcolor(black) lwidth(0.5)) ), legend (order( 1 "Included" 2 "Not included"))
graph export "FigureA1.jpg", as(jpg) name("Graph") quality(100) replace



*TABLE A1

tab result, g(aux_result)
label variable aux_result1 "Incumbent Win / Draw"
label variable aux_result2 "Rebel Victory"
tab warcat, g(aux_warcat)
label variable aux_warcat1 "Rev. Socialist (RS)"
label variable aux_warcat2 "Secessionist"
label variable aux_warcat3 "Marxist National Liberation (RS+Secessionists)"
label variable aux_warcat4 "Other"
tab newcons2, g(aux_newcons)
label variable aux_newcons1 "No"
label variable aux_newcons2 "Yes"
tab amendment, g(aux_amendment)
label variable aux_amendment1 "No"
label variable aux_amendment2 "Yes"
estpost tabstat aux_result1 aux_result2 aux_warcat1 aux_warcat2 aux_warcat3 aux_warcat4 aux_newcons1 aux_newcons2 aux_amendment1 aux_amendment2 dif_total_pwa dif_rights_UDHR_pwa dif_rights_not_UDHR_pwa dif_civpol_pwa dif_social_pwa   dif_econ_rights_pwa dif_legal_proc_rights_pwa dif_physical_int_rights_pwa dif_equal_min_rights_pwa, c(stat) stat(n mean sd min max)

esttab,    cells("count Mean(fmt(%6.2fc)) SD(fmt(%6.2fc)) Min Max      ") nonumber nomtitle nonote noobs label collabels("N" "Mean" "SD" "Min" "Max") refcat(aux_result1 "\textbf{Outcome of the War}" aux_warcat1 "\textbf{Rebel group ideology}" aux_newcons1 "\textbf{New constitution after war}" aux_amendment1 "\textbf{Amendment after war}" dif_total_pwa "\textbf{Pre and post war difference in}")

/*
Notes on exporting.

1. The following code exports the table above to a text file called "TableA1.tex"

esttab using "TableA1.tex", replace   cells("count Mean(fmt(%6.2fc)) SD(fmt(%6.2fc)) Min Max      ") nonumber nomtitle nonote noobs label collabels("N" "Mean" "SD" "Min" "Max") refcat(aux_result1 "\textbf{Outcome of the War}" aux_warcat1 "\textbf{Rebel group ideology}" aux_newcons1 "\textbf{New constitution after war}" aux_amendment1 "\textbf{Amendment after war}" dif_total_pwa "\textbf{Pre and post war difference in}")


2. We modified the previous tex by adding a column labeled 'Proportion' between the 'N' and 'Mean' columns. In all categorical variables ('Rebel Group Ideology', 'New constitution after war' & 'Amendment after war'), we manually cut the 'Mean' values and pasted them in the 'Proportion' column. 

3. We replaced the N column for the categorical variables using the tab below: 'Rebel Group Ideology', 'New constitution after war' & 'Amendment after war'
tab warcat
tab newcons2
tab amendment
tab result
*/

drop aux_*




*TABLE A2

tab interim_pwa, g(aux_interimpre)
label variable aux_interimpre1 "No"
label variable aux_interimpre2 "Yes"
tab interim_awm, g(aux_interimafter)
label variable aux_interimafter1 "No"
label variable aux_interimafter2 "Yes"
tab d_rebel_support, g(aux_rebel) 
label variable aux_rebel1 "No"
label variable aux_rebel2 "Yes"
tab d_gvt_support, g(aux_gvt)
label variable aux_gvt1 "No"
label variable aux_gvt2 "Yes"
tab region5, g(aux_region5)
label variable aux_region51 "Eurasia"
label variable aux_region52 "Asia"
label variable aux_region53 "MENA"
label variable aux_region54 "Sub-Saharan Africa"
label variable aux_region55 "LATAM"
tab decade, g(aux_decade)
label variable aux_decade1 "1940-1949" 
label variable aux_decade2 "1950-1959" 
label variable aux_decade3 "1960-1969" 
label variable aux_decade4 "1970-1979" 
label variable aux_decade5 "1980-1989" 
label variable aux_decade6 "1990-1999" 
label variable aux_decade7 "2000-2009" 
label variable aux_decade8 "2010-2019"

*N for 'Decade war ended', 'New constitution after war' & 'Amendment after war'

tab interim_pwa
tab interim_awm
tab d_gvt_support
tab d_rebel_support
tab region5


estpost tabstat lgdp_pwa lpop_pwa  libdem_pwa  ethfrac relfrac dif_age_pwa aux_decade1 aux_decade2 aux_decade3 aux_decade4 aux_decade5 aux_decade6 aux_decade7 aux_decade8 aux_interimpre1 aux_interimpre2 aux_interimafter1 aux_interimafter2 aux_gvt1 aux_gvt2 aux_rebel1 aux_rebel2 aux_region51 aux_region52 aux_region53 aux_region54 aux_region55 , c(stat) stat(n mean sd min max)

esttab,    cells("count Mean(fmt(%6.2fc)) SD(fmt(%6.2fc)) Min(fmt(%6.2fc)) Max(fmt(%6.2fc))      ") nonumber nomtitle nonote noobs label collabels("N" "Mean" "SD" "Min" "Max") refcat(lgdp_pwa "\textbf{Country indicators}" aux_decade1 "\textbf{Decade war ended}" aux_interimpre1 "\textbf{Interim constitution pre war}" aux_interimafter1 "\textbf{Interim constitution after war}" aux_gvt1 "\textbf{Government external support in the war}" aux_rebel1 "\textbf{Rebel external support in the war}" aux_region51 "\textbf{Region}")

/*
Notes on exporting.

1. The following code exports the table above to a text file called "TableA2.tex"

esttab using "TableA2.tex", replace   cells("count Mean(fmt(%6.2fc)) SD(fmt(%6.2fc)) Min(fmt(%6.2fc)) Max(fmt(%6.2fc))      ") nonumber nomtitle nonote noobs label collabels("N" "Mean" "SD" "Min" "Max") refcat(lgdp_pwa "\textbf{Country indicators}" aux_decade1 "\textbf{Decade war ended}" aux_interimpre1 "\textbf{Interim constitution pre war}" aux_interimafter1 "\textbf{Interim constitution after war}" aux_GvtExtSupp1 "\textbf{Government external support in the war}" aux_RebelExtSupp1 "\textbf{Rebel external support in the war}" aux_region51 "\textbf{Region}")


2. We modified the previous tex by adding a column labeled 'Proportion' between the 'N' and 'Mean' columns. In all categorical variables ('Decade war ended', 'Interim constitution before war', 'Interim constitution after war', 'Government external support in the war', 'Rebel external support in the war' & 'Region'), we manually cut the 'Mean' values and pasted them in the 'Proportion' column. 

3. We replaced the N column for the categorical variables using the tab below: 'Decade war ended', 'Interim constitution before war', 'Interim constitution after war', 'Government external support in the war', 'Rebel external support in the war' & 'Region'
tab decade
tab interim_pwa
tab interim_awm
tab d_gvt_support
tab d_rebel_support
tab region5
*/

drop aux_*




*TABLE A3
 
 firthlogit newcons2 ib(last).BKoutcome lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

firthlogit newcons2 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2

firthlogit amendment ib(last).BKoutcome lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M3
estadd local FE "  YES"
estadd local DE "  YES": M3

firthlogit amendment result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M4
estadd local FE "  YES"
estadd local DE "  YES": M4

firthlogit no_change ib(last).BKoutcome lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac d_rebel_support d_gvt_support rebel_state
est store M5
estadd local FE "  YES"
estadd local DE "  YES": M5

firthlogit no_change result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M6
estadd local FE "  YES"
estadd local DE "  YES": M6

esttab M1 M2 M3 M4 M5 M6  , replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep nomtitle drop(*.region5 2.BKoutcome *.decade) order(0.BKoutcome 1.BKoutcome result) refcat(0.BKoutcome "\textbf{3-category outcome}" result "\textbf{2-category outcome}" lgdp_pwa "{\textbf{Other controls}", nolab)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE"  ) sfmt(3 0)

/*
1. The following code exports the table above to a text file called "TableA3.tex"

esttab M1 M2 M3 M4 M5 M6 using "TableA3.tex", replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep nomtitle drop(*.region5 2.BKoutcome *.decade) order(0.BKoutcome 1.BKoutcome result) refcat(0.BKoutcome "\textbf{3-category outcome}" result "\textbf{2-category outcome}" lgdp_pwa "\textbf{Other controls}", nolab)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" ) sfmt(3 0) booktabs  ///
 title("Determinants of New Constitutions and Amendments after the war \label{Table1}")   mgroups("New Constitutions" "Amendments" "No Change" , pattern(1 0 1 0 1 0)) 
 
 2. To give the right format to the top rows of the table, replace rows 6 and 7 of the corresponding tex file for the following three lines
 
                & \multicolumn{2}{c}{New Constitutions}                   & \multicolumn{2}{c}{Amendments}                            & \multicolumn{2}{c}{No Change}                      \\
               \cmidrule[0.5pt]{2-3} \cmidrule[0.5pt]{4-5} \cmidrule[0.5pt]{6-7}
                &\multicolumn{1}{c}{(1)}         &\multicolumn{1}{c}{(2)}         &\multicolumn{1}{c}{(3)}         &\multicolumn{1}{c}{(4)}         &\multicolumn{1}{c}{(5)}         &\multicolumn{1}{c}{(6)}         \\
*/



*TABLE A4 

firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2

firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M3
estadd local FE "  YES"
estadd local DE "  YES": M3

  esttab M1 M2 M3, replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa 1.socialist 1.secess d_rebel_support d_gvt_support _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" ) sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")  mgroups("New constituion" "Amendment" "No changes", pattern(1 1 1) ) noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab) nomtitle

/*
1. The following code exports the table above to a text file called "TableA4.tex"

  esttab M1 M2 M3 using "TableA4.tex", replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa 1.socialist 1.secess d_rebel_support d_gvt_support _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" ) sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")  mgroups("New constituion" "Amendment" "No changes", pattern(1 1 1) ) noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab) nomtitle
 
2. Adjust some labels:
	- Change "RS=1" for "Rev. Socialist"
	- Change "Secessionist=1" for "Secessionist"
*/  
 

 

 
*TABLE A5

*Identity
 reg dif_identity_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

*Total rights
reg dif_total_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2


 esttab M1 M2, b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa dif_age_pwa interim_pwa interim_awm 1.socialist 1.secess d_rebel_support d_gvt_support _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" ) sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")   noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab) mgroups("Symbolic" "Rights", pattern( 1 1) ) mtitles("contents " "" )
 
/*
1. The following code exports the table above to a text file called "TableA5.tex"

 esttab M1 M2 using "TableA5.tex", replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa dif_age_pwa interim_pwa interim_awm 1.socialist 1.secess d_rebel_support d_gvt_support _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" ) sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")   noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab) mgroups("Symbolic" "Rights", pattern( 1 1) ) mtitles("contents " "" )
 
2. Adjust some labels:
	- Change "RS=1" for "Rev. Socialist"
	- Change "Secessionist=1" for "Secessionist"
*/ 
 
 
 
*TABLE A6 

*Identity
reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

*Total rights
reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2

 
 esttab M1 M2, b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa dif_age_pwa interim_pwa interim_awm 1.non_maoist_rs 1.secess d_rebel_support d_gvt_support 1.maoist _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE"  ) sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")   noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab) mgroups( "Symbolic" "Rights", pattern( 1 1) ) mtitles("contents " "" )
 
 /*
1. The following code exports the table above to a text file called "TableA6.tex"

  esttab M1 M2 using "TableA6.tex", replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa dif_age_pwa interim_pwa interim_awm 1.non_maoist_rs 1.secess 1.maoist d_rebel_support d_gvt_support _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE"  ) sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")   noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab) mgroups( "Symbolic" "Rights", pattern( 1 1) ) mtitles("contents " "" )
 
2. Adjust some labels:
	- Change "non\_maoistrs=1" for "Non-Maoist RS"
	- Change "Secessionist=1" for "Secessionist"
	- Change "maoist=1" for "Maoist RS"
*/ 
 


 
*Table A7   
 
*Civil and Political
reg dif_civpol_pwa result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

*Social 
reg dif_social_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2

*ECONOMIC RIGHTS
reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M3
estadd local FE "  YES"
estadd local DE "  YES": M3
 
*legal procedural
reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M4
estadd local FE "  YES"
estadd local DE "  YES": M4

*legal equality and minorities
 reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M5
estadd local FE "  YES"
estadd local DE "  YES": M5

*Physical
 reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M6
estadd local FE "  YES"
estadd local DE "  YES": M6

 *UDHR
reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M7
estadd local FE "  YES"
estadd local DE "  YES": M7
 
*No UDHR
reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
est store M8
estadd local FE "  YES"
estadd local DE "  YES": M8

 esttab M1 M2 M3 M4 M5 M6 M7 M8, replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa dif_age_pwa interim_pwa interim_awm 1.non_maoist_rs 1.secess d_rebel_support d_gvt_support 1.maoist _cons) order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" )  sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")   noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab)  mgroups("Civil and" "Social" "Economic" "Legal and" "Equality" "Physical" "UDHR" "NO", pattern(1 1 1 1 1 1 1 1) ) mtitles( "Political" " " " " "Procedural " " " "Integrity" " " "UDHR")
 
 /*
1. The following code exports the table above to a text file called "TableA7.tex"

  esttab M1 M2 M3 M4 M5 M6 M7 M8 using "TableA7.tex", replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep  keep (1.result lgdp_pwa lpop_pwa 1.result* ethfrac relfrac libdem_pwa dif_age_pwa interim_pwa interim_awm 1.non_maoist_rs 1.secess 1.maoist d_rebel_support d_gvt_support _cons)order(result)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE"  )  sfmt(0)  ///
 title("Determinants of New Constitutions and Amendments after the war with ideology \label{reg_cc_id}")   noomitted eqlabels(none) unstack nonumbers refcat(lgdp_pwa "\textbf{Other controls}", nolab)  mgroups("Civil and" "Social" "Economic" "Legal and" "Equality" "Physical" "UDHR" "NO", pattern(1 1 1 1 1 1 1 1) ) mtitles( "Political" " " " " "Procedural " " " "Integrity" " " "UDHR")
 
2. Adjust some labels:
	- Change "non\_maoistrs=1" for "Non-Maoist RS"
	- Change "Secessionist=1" for "Secessionist"
	- Change "maoist=1" for "Maoist RS"
*/ 
 
 
 
 
*Figure A4

twoway (histogram dif_total_pwa if warcat3==1 & result==1 & warcat4==1, start(-10) width(5) color(grey) frequency xtitle("Difference in the total number of constitutional rights pre and post-war") ylabel(0(1)2, labsize(medlarge)))  (histogram dif_total_pwa if warcat3==1 & result==1 & warcat4==2, start(-10) width(5) fcolor(none) lcolor(black) frequency), legend(order(1 "Non-Maoist RS" 2 "Maoist RS" ))
 graph export "FigureA4.eps", as(eps) name("Graph") preview(on) replace



 
* Table A8

firthlogit newcons2 ib(last).BKoutcome lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

firthlogit newcons2 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2

firthlogit amendment ib(last).BKoutcome lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
est store M3
estadd local FE "  YES"
estadd local DE "  YES": M3

firthlogit amendment result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
est store M4
estadd local FE "  YES"
estadd local DE "  YES": M4

firthlogit no_change ib(last).BKoutcome lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
est store M5
estadd local FE "  YES"
estadd local DE "  YES": M5

firthlogit no_change result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
est store M6
estadd local FE "  YES"
estadd local DE "  YES": M6

esttab M1 M2 M3 M4 M5 M6  , replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep nomtitle drop(*.region5 2.BKoutcome *.decade) order(0.BKoutcome 1.BKoutcome result) refcat(0.BKoutcome "\textbf{3-category outcome}" result "\textbf{2-category outcome}" lgdp_pwa "{\textbf{Other controls}", nolab)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE") sfmt(3 0)



 /*
1. The following code exports the table above to a text file called "TableA8.tex"

esttab M1 M2 M3 M4 M5 M6 using "TableA8.tex", replace  ///
b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep nomtitle drop(*.region5 2.BKoutcome *.decade) order(0.BKoutcome 1.BKoutcome result) refcat(0.BKoutcome "\textbf{3-category outcome}" result "\textbf{2-category outcome}" lgdp_pwa "\textbf{Other controls}", nolab)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE" ) sfmt(3 0) booktabs  ///
 title("Determinants of New Constitutions and Amendments after the war \label{Table1}")   mgroups("New Constitutions" "Amendments" "No Change" , pattern(1 0 1 0 1 0)) 
 
 2. To give the right format to the top rows of the table, replace rows 6-9 of the corresponding tex file for the following three lines
 
                & \multicolumn{2}{c}{New Constitutions}                   & \multicolumn{2}{c}{Amendments}                            & \multicolumn{2}{c}{No Change}                      \\
               \cmidrule[0.5pt]{2-3} \cmidrule[0.5pt]{4-5} \cmidrule[0.5pt]{6-7}
                &\multicolumn{1}{c}{(1)}         &\multicolumn{1}{c}{(2)}         &\multicolumn{1}{c}{(3)}         &\multicolumn{1}{c}{(4)}         &\multicolumn{1}{c}{(5)}         &\multicolumn{1}{c}{(6)}         \\
\midrule

*/


 
*FIGURE A5 

firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc
firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec

firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc
firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec

firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc
firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support if rebel_state==0
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec


coefplot newcsoc newcsec,  bylabel((a) New Constitution) subtitle(,size(*1.62))     || amendsoc amendsec, bylabel((b) Amendment) || no_changesoc no_changesec, bylabel((c) No change) ||, xline(0) byopts(xrescale rows(1) legend(off)) graphregion(color(white)) ysize(1) xsize(4)  xline(0, lpattern(dash) lcolor(cranberry) lwidth(1.05pt)) nolab drop(0.socialist 0.secess) coeflabel (1.socialist="Socialist  " 1.secess="Secessionist  ") aspectratio(0.7) msize(*3) ciopts(lwidth(*3)) 
addplot 1: ,  xlabel(-1(0.5)1) norescaling ylabel(, labsize(*1.9)) xlabel(, labsize(*1.9)) xscale(range(-1.2 1.2)) 
addplot 2: ,  xlabel(-1(0.5)1) norescaling ylabel(, labsize(*1.9)) xlabel(, labsize(*1.9)) xscale(range(-1.2 1.2))
addplot 3: ,  xlabel(-1(0.5)1) norescaling xscale(range(-1.2 1.2))

  graph export "FigureA5.eps", as(eps) name("Graph") preview(on) replace
 

 
 
 *Figure A6 

 *3 year window
firthlogit newcons2_3 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M1
estadd local FE "  YES"
estadd local DE "  YES": M1

firthlogit amendment_3 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M2
estadd local FE "  YES"
estadd local DE "  YES": M2

firthlogit no_change_3 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M3
estadd local FE "  YES"
estadd local DE "  YES": M3

esttab M1 M2 M3  , replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep nomtitle drop(*.region5  *.decade)  refcat( result "\textbf{2-category outcome}" lgdp_pwa "{\textbf{Other controls}", nolab)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE"  ) sfmt(3 0)


 *4 year window
firthlogit newcons2_4 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M4
estadd local FE "  YES"
estadd local DE "  YES": M4

firthlogit amendment_4 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M5
estadd local FE "  YES"
estadd local DE "  YES": M5

firthlogit no_change_4 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M6
estadd local FE "  YES"
estadd local DE "  YES": M6

esttab M4 M5 M6  , replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) l nogaps nodep nomtitle drop(*.region5  *.decade)  refcat( result "\textbf{2-category outcome}" lgdp_pwa "{\textbf{Other controls}", nolab)  collabels(none) compress scalars("FE Regional FE" "DE Decade FE"  ) sfmt(3 0)


 *5 year window
firthlogit newcons2 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M7
estadd local FE "  YES"
estadd local DE "  YES": M7

firthlogit amendment result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M8
estadd local FE "  YES"
estadd local DE "  YES": M8

firthlogit no_change result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M9
estadd local FE "  YES"
estadd local DE "  YES": M9


 *6 year window
firthlogit newcons2_6 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M10
estadd local FE "  YES"
estadd local DE "  YES": M10

firthlogit amendment_6 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M11
estadd local FE "  YES"
estadd local DE "  YES": M11

firthlogit no_change_6 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M12
estadd local FE "  YES"
estadd local DE "  YES": M12


 *7 year window
firthlogit newcons2_7 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M13
estadd local FE "  YES"
estadd local DE "  YES": M13

firthlogit amendment_7 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M14
estadd local FE "  YES"
estadd local DE "  YES": M14

firthlogit no_change_7 result lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
est store M15
estadd local FE "  YES"
estadd local DE "  YES": M15


coefplot M1 M4 M7 M10 M13, bylabel (New) || M2 M5 M8 M11 M14, bylabel (Amendment) || M3 M6 M9 M12 M15, bylabel (No Change)||, keep (result) byopts(row(1)) xline(0) p1(label(3-year)) p2(label(4-year)) p3(label(5-year)) p4(label(6-year)) p5(label(7-year)) legend(rows(1) size(*1.3)) ylabel(, labsize(*1.3)) xlabel(, labsize(*1.3))
 graph export "FigureA6.eps", as(eps) name("Graph") preview(on) replace


sleep 5000
 
 
 
 
 

 
*Figure A7 

*3-year window
firthlogit newcons2_3 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc_3
firthlogit newcons2_3 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec_3

firthlogit amendment_3 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc_3
firthlogit amendment_3 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec_3

firthlogit no_change_3 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc_3
firthlogit no_change_3 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec_3


*4-year window
firthlogit newcons2_4 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc_4
firthlogit newcons2_4 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec_4

firthlogit amendment_4 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc_4
firthlogit amendment_4 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec_4

firthlogit no_change_4 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc_4
firthlogit no_change_4 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec_4


*5-year window
firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc_5
firthlogit newcons2 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec_5

firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc_5
firthlogit amendment i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec_5

firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc_5
firthlogit no_change i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec_5


*6-year window
firthlogit newcons2_6 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc_6
firthlogit newcons2_6 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec_6

firthlogit amendment_6 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc_6
firthlogit amendment_6 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec_6

firthlogit no_change_6 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc_6
firthlogit no_change_6 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec_6


*7-year window
firthlogit newcons2_7 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsoc_7
firthlogit newcons2_7 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store newcsec_7

firthlogit amendment_7 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsoc_7
firthlogit amendment_7 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store amendsec_7

firthlogit no_change_7 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  socialist, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesoc_7
firthlogit no_change_7 i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac i.decade d_rebel_support d_gvt_support rebel_state
margins  secess, dydx(result)  post atmeans expression(invlogit(predict(xb))) 
est store no_changesec_7


coefplot newcsoc_3 newcsec_3 newcsoc_4 newcsec_4 newcsoc_5 newcsec_5 newcsoc_6 newcsec_6 newcsoc_7 newcsec_7,  bylabel((a) New Constitution) subtitle(,size(*1.05))     || amendsoc_3 amendsec_3 amendsoc_4 amendsec_4 amendsoc_5 amendsec_5 amendsoc_6 amendsec_6 amendsoc_7 amendsec_7, bylabel((b) Amendment) || no_changesoc_3 no_changesec_3 no_changesoc_4 no_changesec_4 no_changesoc_5 no_changesec_5 no_changesoc_6 no_changesec_6 no_changesoc_7 no_changesec_7, bylabel((c) No change) ||, xline(0) byopts(xrescale rows(1) ) graphregion(color(white)) ysize(1) xsize(3.8)  xline(0, lpattern(dash) lcolor(cranberry) lwidth(1.05pt)) nolab drop(0.socialist 0.secess) coeflabel (1.socialist="Socialist  " 1.secess="Secessionist  ") aspectratio(0.7) msize(*3) ciopts(lwidth(*3))  xlabel(-1(0.5)1) ylabel(, labsize(*1.9)) xlabel(, labsize(*1.9)) xscale(range(-1.2 1.2)) p1(label(3-year) mcolor(navy) ciopts(lc(navy)) ) p2(label(3-year) mcolor(navy) ciopts(lc(navy))) p3(label(4-year) mcolor(green) ciopts(lc(green)) ) p4(label(4-year) mcolor(green) ciopts(lc(green))) p5(label(5-year) mcolor(purple) ciopts(lc(purple)) ) p6(label(5-year) mcolor(purple) ciopts(lc(purple))) p7(label(6-year) mcolor(orange) ciopts(lc(orange)) ) p8(label(6-year) mcolor(orange) ciopts(lc(orange))) p9(label(7-year) mcolor(ltblue) ciopts(lc(ltblue)) ) p10(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) legend(rows(1) order(2 6 10 14 18) size(*1.7)) plotregion(margin(zero))

 graph export "FigureA7.eps", as(eps) name("Graph") preview(on) replace


 
 
* Figure A8
 
*Other windows 
foreach i in 3 4 6 7 {
*Identity
reg dif_identity_pwa`i' i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm`i' d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Midentitysoc`i'

reg dif_identity_pwa`i' i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm`i' d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec`i'


*Total rights
reg dif_total_pwa`i' i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm`i' d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Mtotalsoc`i'

reg dif_total_pwa`i' i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm`i' d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec`i'
}

 
*5-year window
*Identity
reg dif_identity_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Midentitysoc5

reg dif_identity_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec5

*Total rights
reg dif_total_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Mtotalsoc5

reg dif_total_pwa i.result##socialist i.result##secess lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec5


coefplot  Midentitysoc3 Midentitysec3 Midentitysoc4 Midentitysec4 Midentitysoc5 Midentitysec5 Midentitysoc6 Midentitysec6 Midentitysoc7 Midentitysec7, bylabel((a) Symbolic Contents) subtitle(,size(*1.08))  ||  Mtotalsoc3 Mtotalsec3 Mtotalsoc4 Mtotalsec4 Mtotalsoc5 Mtotalsec5 Mtotalsoc6 Mtotalsec6 Mtotalsoc7 Mtotalsec7,  bylabel((b) Number of Rights)     ||, xline(0) byopts(xrescale ) graphregion(color(white)) ysize(1.1) xsize(3.8) xline(0, lpattern(dash) lcolor(cranberry) lwidth(1.01pt)) nolab drop(0.socialist 0.secess) coeflabel (1.socialist="Socialist   " 1.secess="Secessionist   ") aspectratio(0.5) msize(*2.5) ciopts(lwidth(*2.5))  ylabel(, labsize(*2.5)) xlabel(, labsize(*2.5)) p1(label(3-year) mcolor(navy) ciopts(lc(navy)) ) p2(label(3-year) mcolor(navy) ciopts(lc(navy))) p3(label(4-year) mcolor(green) ciopts(lc(green)) ) p4(label(4-year) mcolor(green) ciopts(lc(green)))  p5(label(5-year) mcolor(purple) ciopts(lc(purple)) ) p6(label(5-year) mcolor(purple) ciopts(lc(purple))) p7(label(6-year) mcolor(orange) ciopts(lc(orange)) ) p8(label(6-year) mcolor(orange) ciopts(lc(orange))) p9(label(7-year) mcolor(ltblue) ciopts(lc(ltblue)) ) p10(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) legend(rows(1) order(2 6 10 14 18) size(*2.5))

 graph export "FigureA8.eps", as(eps) name("Graph") preview(on) replace




*Figure A9 

*Other window-year window
foreach i in 3 4 6 7 {
*Identity
reg dif_identity_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Midentitysoc`i'

reg dif_identity_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Midentitymao`i'

reg dif_identity_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec`i'


*Total rights
reg dif_total_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mtotalsoc`i'

reg dif_total_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mtotalmao`i'

reg dif_total_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec`i'
}


*5-year window
*Identity
reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Midentitysoc5

reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Midentitymao5

reg dif_identity_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec5

*Total rights
reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mtotalsoc5

reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mtotalmao5

reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec5


coefplot  Midentitysoc3 Midentitymao3 Midentitysec3 Midentitysoc4 Midentitymao4 Midentitysec4 Midentitysoc5 Midentitymao5 Midentitysec5 Midentitysoc6 Midentitymao6 Midentitysec6 Midentitysoc7 Midentitymao7 Midentitysec7, bylabel((a) Symbolic Contents) subtitle(,size(*.95)) ||  Mtotalsoc3 Mtotalmao3 Mtotalsec3 Mtotalsoc4 Mtotalmao4 Mtotalsec4 Mtotalsoc5 Mtotalmao5 Mtotalsec5 Mtotalsoc6 Mtotalmao6 Mtotalsec6 Mtotalsoc7 Mtotalmao7 Mtotalsec7,  bylabel((b) Number of Rights) subtitle(,size(*1.1))    ||, xline(0) byopts(xrescale) graphregion(color(white)) ysize(3.2) xline(0, lpattern(dash) lcolor(cranberry)) nolab drop(0.non_maoist_rs 0.secess 0.maoist) coeflabel (1.non_maoist_rs="Non-Maoist RS  " 1.secess="Secessionist  " 1.maoist="Maoist  ") msize(*1.5) ciopts(lwidth(*1.5)) ylabel(, labsize(*2)) xlabel(, labsize(*2)) p1(label(3-year) mcolor(navy) ciopts(lc(navy)) ) p2(label(3-year) mcolor(navy) ciopts(lc(navy))) p3(label(3-year) mcolor(navy) ciopts(lc(navy))) p4(label(4-year) mcolor(green) ciopts(lc(green))) p5(label(4-year) mcolor(green) ciopts(lc(green))) p6(label(4-year) mcolor(green) ciopts(lc(green)))  p7(label(5-year) mcolor(purple) ciopts(lc(purple))) p8(label(5-year) mcolor(purple) ciopts(lc(purple)) ) p9(label(5-year) mcolor(purple) ciopts(lc(purple))) p10(label(6-year) mcolor(orange) ciopts(lc(orange))) p11(label(6-year) mcolor(orange) ciopts(lc(orange))) p12(label(6-year) mcolor(orange) ciopts(lc(orange))) p13(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) p14(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) p15(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) legend(rows(1) order(2 8 14 20 26) size(*1.7))

 graph export "FigureA9.eps", as(eps) name("Graph") preview(on) replace

 

 
**** FIGURES A10 and A11 

*Other window-year window
foreach i in 3 4 6 7 {
*Civil and political
reg dif_civpol_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mcivpolsoc`i'

reg dif_civpol_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mcivpolmao`i'

reg dif_civpol_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mcivpolsec`i'


*Social rights
reg dif_social_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Msocialsoc`i'

reg dif_social_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Msocialmao`i'

reg dif_total_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Msocialsec`i'


*Econ Rights 
reg dif_econ_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mecon_rightssoc`i'

reg dif_econ_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mecon_rightsmao`i'

reg dif_econ_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mecon_rightssec`i'


*Legal Procedural RIghts - 
reg dif_legal_proc_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mlegal_proc_rightssoc`i'

reg dif_legal_proc_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mlegal_proc_rightsmao`i'

reg dif_legal_proc_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mlegal_proc_rightssec`i'

*Legal Equality and Minority 
reg dif_equal_min_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mequal_min_rightssoc`i'

reg dif_equal_min_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mequal_min_rightsmao`i'

reg dif_equal_min_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mequal_min_rightssec`i'

*Physical Integrity Rights 
reg dif_physical_int_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mphysical_int_rightssoc`i'

reg dif_physical_int_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mphysical_int_rightsmao`i'

reg dif_physical_int_rights_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mphysical_int_rightssec`i'

** UDHR 
reg dif_rights_UDHR_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mrights_UDHRsoc`i'

reg dif_rights_UDHR_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mrights_UDHRmao`i'

reg dif_rights_UDHR_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mrights_UDHRsec`i'

* NO UDHR
reg dif_rights_not_UDHR_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mrights_not_UDHRsoc`i'

reg dif_rights_not_UDHR_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mrights_not_UDHRmao`i'

reg dif_rights_not_UDHR_pwa`i' i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mrights_not_UDHRsec`i'
}


*5-year window
*Identity
*Civil and political
reg dif_civpol_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mcivpolsoc5

reg dif_civpol_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mcivpolmao5

reg dif_civpol_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mcivpolsec5


*Social rights
reg dif_social_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Msocialsoc5

reg dif_social_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Msocialmao5

reg dif_total_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Msocialsec5


*Econ Rights 
reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mecon_rightssoc5

reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mecon_rightsmao5

reg dif_econ_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mecon_rightssec5


*Legal Procedural RIghts - 
reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mlegal_proc_rightssoc5

reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mlegal_proc_rightsmao5

reg dif_legal_proc_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mlegal_proc_rightssec5

*Legal Equality and Minority 
reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mequal_min_rightssoc5

reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mequal_min_rightsmao5

reg dif_equal_min_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mequal_min_rightssec5

*Physical Integrity Rights 
reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mphysical_int_rightssoc5

reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mphysical_int_rightsmao5

reg dif_physical_int_rights_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mphysical_int_rightssec5

** UDHR 
reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mrights_UDHRsoc5

reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mrights_UDHRmao5

reg dif_rights_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mrights_UDHRsec5

* NO UDHR
reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mrights_not_UDHRsoc5

reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mrights_not_UDHRmao5

reg dif_rights_not_UDHR_pwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa`i' interim_pwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mrights_not_UDHRsec5
 

*Figure A10
coefplot  Mcivpolsoc3 Mcivpolmao3 Mcivpolsec3 Mcivpolsoc4 Mcivpolmao4 Mcivpolsec4 Mcivpolsoc5 Mcivpolmao5 Mcivpolsec5 Mcivpolsoc6 Mcivpolmao6 Mcivpolsec6 Mcivpolsoc7 Mcivpolmao7 Mcivpolsec7, bylabel((a) Civil and Political) subtitle(,size(*1)) ||  Msocialsoc3 Msocialmao3 Msocialsec3 Msocialsoc4 Msocialmao4 Msocialsec4 Msocialsoc5 Msocialmao5 Msocialsec5 Msocialsoc6 Msocialmao6 Msocialsec6 Msocialsoc7 Msocialmao7 Msocialsec7,  bylabel((b) Social) subtitle(,size(*1))    || Mecon_rightssoc3 Mecon_rightsmao3 Mecon_rightssec3 Mecon_rightssoc4 Mecon_rightsmao4 Mecon_rightssec4 Mecon_rightssoc5 Mecon_rightsmao5 Mecon_rightssec5 Mecon_rightssoc6 Mecon_rightsmao6 Mecon_rightssec6 Mecon_rightssoc7 Mecon_rightsmao7 Mecon_rightssec7,  bylabel((C) Economic) subtitle(,size(*1))    ||  Mlegal_proc_rightssoc3 Mlegal_proc_rightsmao3 Mlegal_proc_rightssec3  Mlegal_proc_rightssoc4 Mlegal_proc_rightsmao4 Mlegal_proc_rightssec4 Mlegal_proc_rightssoc5 Mlegal_proc_rightsmao5 Mlegal_proc_rightssec5  Mlegal_proc_rightssoc6 Mlegal_proc_rightsmao6 Mlegal_proc_rightssec6  Mlegal_proc_rightssoc7 Mlegal_proc_rightsmao7 Mlegal_proc_rightssec7,  bylabel((d) Legal Procedural) subtitle(,size(*1))    ||  Mequal_min_rightssoc3 Mequal_min_rightsmao3 Mequal_min_rightssec3 Mequal_min_rightssoc4 Mequal_min_rightsmao4 Mequal_min_rightssec4 Mequal_min_rightssoc5 Mequal_min_rightsmao5 Mequal_min_rightssec5 Mequal_min_rightssoc6 Mequal_min_rightsmao6 Mequal_min_rightssec6 Mequal_min_rightssoc7 Mequal_min_rightsmao7 Mequal_min_rightssec7,  bylabel((d) Equality) subtitle(,size(*1))    ||  Mphysical_int_rightssoc3 Mphysical_int_rightsmao3 Mphysical_int_rightssec3 Mphysical_int_rightssoc4 Mphysical_int_rightsmao4 Mphysical_int_rightssec4 Mphysical_int_rightssoc5 Mphysical_int_rightsmao5 Mphysical_int_rightssec5 Mphysical_int_rightssoc6 Mphysical_int_rightsmao6 Mphysical_int_rightssec6 Mphysical_int_rightssoc7 Mphysical_int_rightsmao7 Mphysical_int_rightssec7,  bylabel((e) Physical Integrity) subtitle(,size(*0.9))    ||, xline(0) byopts(xrescale) graphregion(color(white)) ysize(8.2) xsize(10) xline(0, lpattern(dash) lcolor(cranberry)) nolab drop(0.non_maoist_rs 0.secess 0.maoist) coeflabel (1.non_maoist_rs="Non-Maoist RS  " 1.secess="Secessionist  " 1.maoist="Maoist  ") msize(*1.5) ciopts(lwidth(*1.5)) ylabel(, labsize(*1)) xlabel(, labsize(*1)) p1(label(3-year) mcolor(navy) ciopts(lc(navy)) ) p2(label(3-year) mcolor(navy) ciopts(lc(navy))) p3(label(3-year) mcolor(navy) ciopts(lc(navy))) p4(label(4-year) mcolor(green) ciopts(lc(green))) p5(label(4-year) mcolor(green) ciopts(lc(green))) p6(label(4-year) mcolor(green) ciopts(lc(green)))  p7(label(5-year) mcolor(purple) ciopts(lc(purple))) p8(label(5-year) mcolor(purple) ciopts(lc(purple)) ) p9(label(5-year) mcolor(purple) ciopts(lc(purple))) p10(label(6-year) mcolor(orange) ciopts(lc(orange))) p11(label(6-year) mcolor(orange) ciopts(lc(orange))) p12(label(6-year) mcolor(orange) ciopts(lc(orange))) p13(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) p14(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) p15(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) legend(rows(1) order(2 8 14 20 26) size(*1))

 graph export "FigureA10.eps", as(eps) name("Graph") preview(on) replace


 
*Figure A11
coefplot  Mrights_UDHRsoc3 Mrights_UDHRmao3 Mrights_UDHRsec3 Mrights_UDHRsoc4 Mrights_UDHRmao4 Mrights_UDHRsec4 Mrights_UDHRsoc5 Mrights_UDHRmao5 Mrights_UDHRsec5 Mrights_UDHRsoc6 Mrights_UDHRmao6 Mrights_UDHRsec6 Mrights_UDHRsoc7 Mrights_UDHRmao7 Mrights_UDHRsec7, bylabel((a) Rights in the UDHR) subtitle(,size(*.95)) ||  Mrights_not_UDHRsoc3 Mrights_not_UDHRmao3 Mrights_not_UDHRsec3 Mrights_not_UDHRsoc4 Mrights_not_UDHRmao4 Mrights_not_UDHRsec4 Mrights_not_UDHRsoc5 Mrights_not_UDHRmao5 Mrights_not_UDHRsec5 Mrights_not_UDHRsoc6 Mrights_not_UDHRmao6 Mrights_not_UDHRsec6 Mrights_not_UDHRsoc7 Mrights_not_UDHRmao7 Mrights_not_UDHRsec7,  bylabel((b) Rights not in the UDHR) subtitle(,size(*1.1))    ||, xline(0) byopts(xrescale) graphregion(color(white)) ysize(3.2) xline(0, lpattern(dash) lcolor(cranberry)) nolab drop(0.non_maoist_rs 0.secess 0.maoist) coeflabel (1.non_maoist_rs="Non-Maoist RS  " 1.secess="Secessionist  " 1.maoist="Maoist  ") msize(*1.5) ciopts(lwidth(*1.5)) ylabel(, labsize(*2)) xlabel(, labsize(*2)) p1(label(3-year) mcolor(navy) ciopts(lc(navy)) ) p2(label(3-year) mcolor(navy) ciopts(lc(navy))) p3(label(3-year) mcolor(navy) ciopts(lc(navy))) p4(label(4-year) mcolor(green) ciopts(lc(green))) p5(label(4-year) mcolor(green) ciopts(lc(green))) p6(label(4-year) mcolor(green) ciopts(lc(green)))  p7(label(5-year) mcolor(purple) ciopts(lc(purple))) p8(label(5-year) mcolor(purple) ciopts(lc(purple)) ) p9(label(5-year) mcolor(purple) ciopts(lc(purple))) p10(label(6-year) mcolor(orange) ciopts(lc(orange))) p11(label(6-year) mcolor(orange) ciopts(lc(orange))) p12(label(6-year) mcolor(orange) ciopts(lc(orange))) p13(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) p14(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) p15(label(7-year) mcolor(ltblue) ciopts(lc(ltblue))) legend(rows(1) order(2 8 14 20 26) size(*1.7))

graph export "FigureA11.eps", as(eps) name("Graph") preview(on) replace

 
 
 
*Figure A12 
*Identity
reg dif_identity_lwa i.result##socialist i.result##secess lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Midentitysoc

reg dif_identity_lwa i.result##socialist i.result##secess lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec


*Total rights
reg dif_total_lwa i.result##socialist i.result##secess lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  socialist, dydx(result) post atmeans
est store Mtotalsoc

reg dif_total_lwa i.result##socialist i.result##secess lgdp_pwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec


coefplot  Midentitysoc Midentitysec, bylabel((a) Symbolic Contents) subtitle(,size(*1.3))  ||  Mtotalsoc Mtotalsec,  bylabel((b) Number of Rights) subtitle(,size(*1.3))     ||, xline(0) byopts(xrescale rows(1) legend(off)) graphregion(color(white)) ysize(1.1) xsize(3.8) xline(0, lpattern(dash) lcolor(cranberry) lwidth(1.01pt)) nolab drop(0.socialist 0.secess) coeflabel (1.socialist="Socialist   " 1.secess="Secessionist   ") aspectratio(0.5) msize(*2.5) ciopts(lwidth(*2.5)) 
addplot 1: ,  xlabel(-5(2)5) norescaling ylabel(, labsize(*3)) xlabel(, labsize(*3)) xscale(range(-5.5 5.5)) 
addplot 2: ,   xlabel(-40(20)40) norescaling xscale(range(-45 45)) 

graph export "FigureA12.eps", as(eps) name("Graph") preview(on) replace
 
 
 

 * Figure A13 
 
 *Identity
reg dif_identity_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Midentitysoc

reg dif_identity_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Midentitymao

reg dif_identity_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Midentitysec

*Total rights
reg dif_total_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
est store Mtotalsoc

reg dif_total_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
est store Mtotalmao

reg dif_total_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
est store Mtotalsec


coefplot  Midentitysoc Midentitymao Midentitysec, bylabel((a) Symbolic Contents) subtitle(,size(*1.05)) ||  Mtotalsoc Mtotalmao Mtotalsec,  bylabel((b) Number of Rights) subtitle(,size(*1.1))    ||, xline(0) byopts(xrescale rows(1) legend(off)) graphregion(color(white)) ysize(3.2) xline(0, lpattern(dash) lcolor(cranberry)) nolab drop(0.non_maoist_rs 0.secess 0.maoist) coeflabel (1.non_maoist_rs="Non-Maoist RS  " 1.secess="Secessionist  " 1.maoist="Maoist  ") msize(*1.5) ciopts(lwidth(*1.5))
addplot 1: ,  xlabel(-6(2)6) norescaling ylabel(, labsize(*1.7)) xlabel(, labsize(*1.7)) xscale(range(-6.5 6.5)) 
addplot 2: ,   xlabel(-60(20)60) norescaling xscale(range(-65 65)) 
 graph export "FigureA13.eps", as(eps) name("Graph") preview(on) replace




*Table A9

program appendmodels, eclass
    // using first equation of model
    version 8
    syntax namelist
    tempname b V tmp
    foreach name of local namelist {
        qui est restore `name'
        mat `tmp' = e(b)
        local eq1: coleq `tmp'
        gettoken eq1 : eq1
        mat `tmp' = `tmp'[1,"`eq1':"]
        local cons = colnumb(`tmp',"_cons")
        if `cons'<. & `cons'>1 {
            mat `tmp' = `tmp'[1,1..`cons'-1]
        }
        mat `b' = nullmat(`b') , `tmp'
        mat `tmp' = e(V)
        mat `tmp' = `tmp'["`eq1':","`eq1':"]
        if `cons'<. & `cons'>1 {
            mat `tmp' = `tmp'[1..`cons'-1,1..`cons'-1]
        }
        capt confirm matrix `V'
        if _rc {
            mat `V' = `tmp'
        }
        else {
            mat `V' = ///
            ( `V' , J(rowsof(`V'),colsof(`tmp'),0) ) \ ///
            ( J(rowsof(`tmp'),colsof(`V'),0) , `tmp' )
        }
    }
    local names: colfullnames `b'
    mat coln `V' = `names'
    mat rown `V' = `names'
    eret post `b' `V'
    eret local cmd "whatever"
end


*Civil and Political
reg dif_civpol_lwa result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans 
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_civpol_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_civpol_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo civpolrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


*Social 
reg dif_social_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc


reg dif_social_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_social_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo socialrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec

 
*ECONOMIC RIGHTS
reg dif_econ_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_econ_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_econ_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo econrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec

 
*legal procedural
reg dif_legal_proc_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_legal_proc_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_legal_proc_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo procrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec

 
*legal equality and minorities
 reg dif_equal_min_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

 reg dif_equal_min_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

 reg dif_equal_min_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo equalrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec



*Physical
 reg dif_physical_int_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

 reg dif_physical_int_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

 reg dif_physical_int_rights_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo physrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


 *UDHR
reg dif_rights_UDHR_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_rights_UDHR_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_rights_UDHR_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo udhrrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


*No UDHR
reg dif_rights_not_UDHR_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store Mcivpolsoc

reg dif_rights_not_UDHR_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store Mcivpolmao

reg dif_rights_not_UDHR_lwa i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_lwa lpop_lwa  libdem_lwa ib(last).region5 ethfrac relfrac  dif_age_lwa interim_lwa interim_awm d_rebel_support d_gvt_support i.decade, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store Mcivpolsec

eststo noudhrrights: appendmodels Mcivpolsoc Mcivpolmao Mcivpolsec


esttab civpolrights socialrights econrights procrights equalrights physrights udhrrights noudhrrights,  rename (lc_1 "Non-Maoist RS" lc_1 "Maoist RS" lc_1 "Secessionist" ) replace b(2) se(2)  se star(* 0.10 ** 0.05 *** 0.01 )  noomitted unstack  l nogaps nodep  mgroups("Civil and" "Social" "Economic" "Legal and" "Equality" "Physical" "UDHR" "NO", pattern(1 1 1 1 1 1 1 1) ) mtitles( "Political" " " " " "Procedural " " " "Integrity" " " "UDHR")  nonumbers  compress  title("Marginal effects by type of rights \label{merights}") eqlabels(none)

/*
esttab civpolrights socialrights econrights procrights equalrights physrights udhrrights noudhrrights using "TableA9.tex",  rename (lc_1 "Non-Maoist RS" lc_1 "Maoist RS" lc_1 "Secessionist" ) replace b(2) se(2)  se star(* 0.10 ** 0.05 *** 0.01 )  noomitted unstack  l nogaps nodep  mgroups("Civil and" "Social" "Economic" "Legal and" "Equality" "Physical" "UDHR" "NO", pattern(1 1 1 1 1 1 1 1) ) mtitles( "Political" " " " " "Procedural " " " "Integrity" " " "UDHR")  nonumbers  compress  title("Marginal effects by type of rights \label{merights}") eqlabels(none)
*Number of observations imputed manually in tex file from the regression outcome.
*/



*Table A10 - Compliance

*Civil and Political
reg cc_alt_cp_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_alt_cp_pwa, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store C_civil11

reg cc_alt_cp_awm i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_alt_cp_pwa, vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store C_civil12

reg cc_alt_cp_awm i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_alt_cp_pwa, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store C_civil13

eststo compcivil: appendmodels C_civil11 C_civil12 C_civil13


* Human Rights
reg cc_basic_awm i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_basic_pwa, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store C_human11

reg cc_basic_awm i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_basic_pwa,  vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store C_human12

reg cc_basic_awm i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_basic_pwa, vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store C_human13

eststo comphuman: appendmodels C_human11 C_human12 C_human13


*Property and rule of law
reg cc_prop_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade  cc_prop_pwa, vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store C_prop11

reg cc_prop_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_prop_pwa , vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store C_prop12

reg cc_prop_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_prop_pwa , vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store C_prop13

eststo compprop: appendmodels C_prop11 C_prop12 C_prop13


*Total
reg cc_total_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_total_pwa , vce(cluster country)
margins  non_maoist_rs, dydx(result) post atmeans
xlincom _b[1.result:1.non_maoist_rs], post
est store C_total11

reg cc_total_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_total_pwa , vce(cluster country)
margins  maoist, dydx(result) post atmeans
xlincom _b[1.result:1.maoist], post
est store C_total12

reg cc_total_awm  i.result##non_maoist_rs i.result##secess i.result##maoist lgdp_pwa lpop_pwa  libdem_pwa ib(last).region5 ethfrac relfrac  dif_age_pwa interim_pwa interim_awm d_rebel_support d_gvt_support i.decade cc_total_pwa , vce(cluster country)
margins  secess, dydx(result) post atmeans
xlincom _b[1.result:1.secess], post
est store C_total13

eststo comptotal: appendmodels C_total11 C_total12 C_total13


esttab compcivil comphuman compprop comptotal, replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) rename (lc_1 "Non-Maoist RS" lc_1 "Maoist RS" lc_1 "Secessionist" )  noomitted unstack  l nogaps nodep   mgroups("Civil and" "Human" "Property"  "Total" , pattern(1 1 1 1 ) ) mtitles( "Political"  " "  " "  " "  )  nonumbers  compress  title("Marginal effects by type of rights ") eqlabels(none)

/*
esttab compcivil comphuman compprop comptotal using "TableA10.tex", replace b(3) se(3)  se star(* 0.10 ** 0.05 *** 0.01 ) rename (lc_1 "Non-Maoist RS" lc_1 "Maoist RS" lc_1 "Secessionist" )  noomitted unstack  l nogaps nodep   mgroups("Civil and" "Human" "Property"  "Total" , pattern(1 1 1 1 ) ) mtitles( "Political"  " "  " "  " "  )  nonumbers  compress  title("Marginal effects by type of rights ") eqlabels(none)
*Number of observations imputed manually in tex file from the regression outcome.
*/







*************************
*** Figures A2 and A3 ***
*************************


*Merging the Rebel Ideology Data with the detailed CCP data to build similarity index before the end of the war and after the war.
clear all
set more off 


*Packages needed
*Scheme:
net install scheme-modern, from("https://raw.githubusercontent.com/mdroste/stata-scheme-modern/master/")
* Addplot
ssc install addplot
* Coefplot
ssc install coefplot

set scheme modern


cd ""

use reb_ideol_const_design_data, clear


keep ccode country amendment newcons2 no_change yrst yrend yr_awm cowcode conflict result BKoutcome yr_lwa

ren yr_lwa yr0
ren yr_awm yr1


*reshaping the data to create two observations per case with a single year variable. In the first observation the year corresponds to one year before the end of the war (yr0) and in the second to five years after the end of the war (yr1).
reshape long yr, i(ccode) j(year)
 
drop year
 
ren yr year
 
 
*Assign pre-war constitution for newly independent countries
*Algeria
replace cowcode=220 if ccode=="ALG1" & year==1961
*Bosnia
replace cowcode=340 if ccode=="BOS1" & year==1994
*Croatia
replace cowcode=340 if ccode=="CRO1" & year==1990
*Namibia
replace cowcode=560 if ccode=="NAM1" & year==1988
*Timor
replace cowcode=860 if ccode=="IDN5" & year==2004
*Eritrea
replace cowcode=531 if ccode=="ETH1" & year==1997
*Kosovo
replace cowcode=347 if ccode=="YUG1"
*Bangladesh
replace cowcode=771 if ccode=="PAK1" & year==1976
*China 2 es taiwan
replace cowcode=713 if ccode=="CHI2" 


*Drop rebel states without constitutional data after civil war
drop if ccode =="CYP2"
drop if ccode =="MLD1"
drop if ccode =="AZE1"
drop if ccode =="GRG3"
drop if ccode =="GRG2"
drop if ccode =="GRG1"
 

sort cowcode year

*Merge with CCP data
merge cowcode year using ccp_ordered.dta

*Keep only cases with perfect match
keep if _merge==3


*Keep only relevant variables
keep ccode year country conflict result BKoutcome amendment newcons2 no_change amend artists atgen bank bankrupt cabinet cappun cc census comchief commit corppun custlaw depexec econplan educate em env execnum exsess_98 federal_98 fortrad govmed headforn hosdec hoselect hosimm hossucc hr interp_1 interp_2 interp_3 interp_4 interp_5 interp_6 interp_7 intlaw intorgs jc jrem judcrts_1 judcrts_2 judcrts_3 judcrts_4 judcrts_5 judcrts_6 judcrts_7 judcrts_8 judcrts_9 lang legapp levjud lhselect_98 medcom military nat natcit oath offrel ombuds oversght part preamble quorum remleg specleg_1 specleg_2 specleg_3 specleg_4 specleg_5 tranprov treat truthcom voteres war_1 war_2 war_3 war_4 war_5 war_6 war_7 war_8


sort ccode year

bys ccode: gen period=_n

encode ccode, g(ccode1)

xtset ccode1 period


*Create a variable that assign a 0 if the content of the current constitution is different than the content of the constitution in the previous period and a 1 if they coincide.
foreach var of varlist amend artists atgen bank bankrupt cabinet cappun cc census comchief commit corppun custlaw depexec econplan educate em env execnum exsess_98 federal_98 fortrad govmed headforn hosdec hoselect hosimm hossucc hr interp_1 interp_2 interp_3 interp_4 interp_5 interp_6 interp_7 intlaw intorgs jc jrem judcrts_1 judcrts_2 judcrts_3 judcrts_4 judcrts_5 judcrts_6 judcrts_7 judcrts_8 judcrts_9 lang legapp levjud lhselect_98 medcom military nat natcit oath offrel ombuds oversght part preamble quorum remleg specleg_1 specleg_2 specleg_3 specleg_4 specleg_5 tranprov treat truthcom voteres war_1 war_2 war_3 war_4 war_5 war_6 war_7 war_8 {
gen aux_`var'=.
bys ccode1: replace aux_`var'=0 if `var'!= `var'[_n-1]
bys ccode1: replace aux_`var'=1 if `var'== `var'[_n-1]	
}


sort tranprov ccode

** Drop cases without data before or after the war.
foreach var in UGA1 IDN2 RWA3 UGA4 BUR1 PAK2 IRQ5 IRQ4 IDN1 THA1 BUR2 SRI1 THA1 CHI1 UGA1 IRQ1 ZAI4 MYA3 CHD1 CHD1 CHD2 IRQ3 IDN1 IRQ5 IRQ4 OMN1 UGA3 YEM3 GRE1 NIG1 CUB1 LBY1 SOM4 MYA3 MYA2 NIG2 NIG1 OMN1 YEM1 ZAI5 SOM2 IRQ3 BUR3 IRQ2 PAK2 PAK1 YEM1 IRQ1  {
	drop if ccode=="`var'"
}

*Keep only one observation per case
keep if period==2


*Gen index
egen suma=rowtotal(aux*)

gen indice = suma/82


*Keep only relevant variables
keep indice country conflict ccode year newcons2 amendment no_change BKoutcome result


*Gen index for amendment and new constitutions
gen indice_amen=indice
replace indice_amen=. if amendment==0 | (amendment==1 & newcons2==1)
gen indice_newcons=indice
replace indice_newcons=. if newcons2==0 | (amendment==1 & newcons2==1)


** Figure A2

twoway (histogram indice_amen,   color(red%30) frequency xtitle("Years after the war in which a new constitution was enacted") xscale(range(0.5 1)) xlabel(0.5(.1)1) discrete  ) (histogram indice_newcons,   color(green%30) frequency xtitle("Similarity Index") xscale(range(0.5 1)) xlabel(0.5(.1)1) discrete ), legend (order( 1 "Amended" 2 "Replaced"))
graph export "FigureA2.eps", as(eps) name("Graph") replace


*Gen index for draws and incumbent victory
gen indice_draw=indice
replace indice_draw=. if BKoutcome!=1
gen indice_incum=indice
replace indice_incum=. if BKoutcome!=2



*Figure A3
twoway (histogram indice_draw,   color(red%30) frequency xtitle("Years after the war in which a new constitution was enacted") xscale(range(0.5 1)) xlabel(0.5(.1)1) discrete  ) (histogram indice_incum,   color(green%30) frequency xtitle("Similarity Index") xscale(range(0.5 1)) xlabel(0.5(.1)1) discrete ), legend (order( 1 "Draw" 2 "Incumbent Victory"))
graph export "FigureA3.eps", as(eps) name("Graph") replace

summ indice_draw 
summ indice_incum 

